package com.aohanyao.transformer;

import com.aohanyao.utils.PxUtil;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class ExampleOhosTest {
    @Test
    public void testBundleName() {
        final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
        assertEquals("com.aohanyao.transformer", actualBundleName);
    }

    /**
     * 单元测试，获取屏幕的高度非空
     */
    @Test
    public void testScreenHeight(){
        PxUtil.initContext(AbilityDelegatorRegistry.getAbilityDelegator().getAppContext());
        assertNotNull(PxUtil.screenHeight());
    }

    /**
     * 单元测试，获取屏幕的宽度非空
     */
    @Test
    public void testScreenWidth(){
        PxUtil.initContext(AbilityDelegatorRegistry.getAbilityDelegator().getAppContext());
        assertNotNull(PxUtil.screenWidth());
    }
}